package com.iot.ic.controller;

import com.iot.ic.base.BaseController;
import com.iot.ic.model.Location;
import com.iot.ic.service.LocationService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by xiuge on 2017/7/10.
 */
@RestController
@Api(description = "车队位置信息相关接口")
public class LocationController extends BaseController{

    @Autowired
    private LocationService locationService;

    /**
     * 插入一条新的位置数据
     * @param location
     * @return
     */
    @PostMapping("/locations")
    public Integer uploadLocation(Location location){
        int result=locationService.addLocation(location);
        return result;
    }

}
